/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Game;

import Cards.Card;
import java.util.ArrayList;

/**
 * Class Player. It can use to manage any Player with a id and a hand
 * @author escabia
 * @param <C>
 */
public class Player<C extends Card> {
    protected String id;
    protected ArrayList<C> hand;    //La mano
    
    /**
     * This method initializes hand
     * @param id
     */
    public Player(String id){
        this.id = id;
        hand = new ArrayList<>();
    }
    
    /**
     * Method to get id
     * @return id player
     */
    public String getId(){
        return id;
    }
    
    /**
     * Method to add cart to hand
     * @param c card to add to hand
     */
    public void addCardToHand(C c){
        hand.add(c);
    }

    /**
     * Method to get hand
     * @return hand
     */
    public ArrayList<C> getHand(){
        return hand;
    }
    
    /**
     * Method that returns the ID of this player.
     * @return id
     */
    @Override
    public String toString(){
        return this.id;
    }

}
